package net.sk.china.city.domain.vo;


import lombok.Data;


@Data
public class LatestOrdersVO {
    /** 订单编号 */
    private Long orderNumber;

    //商品名称
    private String productName;

    //店铺名称
    private String shopName;

    /** 数量 */
    private Integer amount;

    /** 支付金额(单位分) */
    private Integer totalPrice;

    /** 订单状态（0待付款，1待发货，2待收货，3已收货，4售后，5退款 6 已取消 7 已废弃） */
    private Integer orderStatus;

    // 枚举定义订单状态对应的文字描述
    public enum OrderStatus {
        WAIT_PAYMENT(0, "待付款"),
        WAIT_SHIPMENT(1, "待发货"),
        WAIT_RECEIVE(2, "待收货"),
        RECEIVED(3, "已收货"),
        AFTER_SALES(4, "售后"),
        REFUND(5, "退款"),
        CANCELED(6, "已取消"),
        DISCARDED(7, "已废弃");
        private int value;
        private String description;
        OrderStatus(int value, String description) {
            this.value = value;
            this.description = description;
        }
        public int getValue() {
            return value;
        }
        public String getDescription() {
            return description;
        }
    }
    public String getOrderStatus() {
        for (OrderStatus status : OrderStatus.values()) {
            if (status.getValue() == orderStatus) {
                return status.getDescription();
            }
        }
        return "未知状态";
    }
}
